hysop.backend.host.fortran.operator.poisson_curl module

class hysop.backend.host.fortran.operator.poisson_curl.FortranPoissonCurl(vorticity, velocity, variables, diffusion=None, dt=None, projection=None, dump_energy=None, dump_velocity_energy=None, dump_input_vorticity_energy=None, dump_output_vorticity_energy=None, plot_energy=None, plot_velocity_energy=None, plot_input_vorticity_energy=None, plot_output_vorticity_energy=None, plot_inout_vorticity_energy=None, **kwds)[source]

Bases: PoissonCurlOperatorBase, FortranFFTWOperator

PoissonCurl operator to solve incompressible flows using various fft backends.

Parameters:
  • velocity (:class:`~hysop.fields.continuous_field.Field) – Output solution velocity field.

  • vorticity (Field) – Input vorticity to be diffused, projected. If diffused and/or projected, vorticity is also an output.

  • variables (dict) – Dictionary of Fields as keys and topologies as values.

  • diffusion (ScalarParameter, optional, defaults to None.) – Diffuse the vorticity field before applying projection and poisson velocity.

  • dt (ScalarParameter, optional, defaults to None) – Timestep is only required for diffusion. If diffusion is not enabled, this parameter is ignored.

  • projection (hysop.constants.FieldProjection or positive integer, optional) – Project vorticity such that resolved velocity is divergence free (for 3D fields). When active, projection is done prior to every solve, unless projection is an integer in which case it is done every given steps. This parameter is ignored for 2D fields and defaults to no projection.

  • dump_energy (IOParams, optional, defaults to None) – Will set the default io parameter for all energy plotters.

  • dump_velocity_energy (IOParams, optional, defaults to None) – Dump velocity field energy to a custom file. Defaults to no dump.

  • dump_input_vorticity_energy (IOParams, optional, defaults to None) – Dump input vorticity field energy to a custom file. Defaults to no dump.

  • dump_output_vorticity_energy (IOParams, optional, defaults to None) – Dump output vorticity field energy to a custom file. Defaults to no dump.

  • plot_energy (IOParams, optional, defaults to None) – Will set the default io parameter for all energy plotters.

  • plot_velocity_energy (IOParams, optional, defaults to None) – Plot velocity field energy and save the plot to a custom file. Defaults to no plot.

  • plot_input_vorticity_energy (IOParams, optional, defaults to None) – Plot input vorticity field energy and save the plot to a custom file. Defaults to no plot.

  • plot_output_vorticity_energy (IOParams, optional, defaults to None) – Plot output vorticity field energy and save the plot to a custom file. Defaults to no plot.

  • plot_inout_vorticity_energy (IOParams, optional, defaults to None) – Plot vorticity field energy before and after diffusion and projection on the same graph.

  • kwds – Base class parameters.

  • Notes

  • ------

  • dumping. (All dump energy arguments also enables scalar energy)

  • plotting. (This is not true for energy)

  • arguments. (Passing an integer instead of a IOParams will disable dump and plot)

apply(**kwds)

Abstract method that should be implemented. Applies this node (operator, computational graph operator…).

discretize()[source]

By default, an operator discretize all its variables. For each input continuous field that is also an output field, input topology may be different from the output topology.

After this call, one can access self.input_discrete_fields and self.output_discrete_fields, which contains input and output dicretised fields mapped by continuous fields.

self.discrete_fields will be a tuple containing all input and output discrete fields.

Discrete tensor fields are built back from discretized scalar fields and are accessible from self.input_tensor_fields, self.output_tensor_fields and self.discrete_tensor_fields like their scalar counterpart.

initialize(**kwds)[source]

Initialize this node.

Initialization step sets the following variables:

*self.method, *self.input_field_requirements *self.output_field_requirements *self.initialized

It returns self.method.

Order of execution is:

self.pre_initialize() self._setup_method() self.handle_method() self.get_field_requirements() self._initialized = True self.post_initialize()

See ComputationalGraphNode.handle_method() to see how user method is handled. See ComputationalGraphNode.get_field_requirements() to see how topology requirements are handled.

After this method has been handled by all operators, initialization collects min and max ghosts required by each operators which will be usefull in the discretiezation step to automatically build topologies or check against user supplied topologies.

This function also sets the self.initialized flag to True (just before post initialization). Once this flag is set one may call ComputationalGraphNode.discretize().